/*
 * @Author: KKKKKK
 * @Date: 2021-01-10 12:08:35
 * @LastEditors: KKKKKK
 * @LastEditTime: 2021-01-10 12:08:35
 */
import axios from './config'
import url from './url'
const baseUrl = process.env.VUE_APP_BASE_URL

/* 交易记录 */
// 新增交易记录
const transactionCreate = (params) => axios.post(baseUrl + url.transaction.create, params)

// 删除交易记录
const transactionDelete = (id) => axios.delete(baseUrl + url.transaction.delete + `/${id}`)

// 修改交易记录
const transactionUpdate = (params, id) => axios.post(baseUrl + url.transaction.update + `/${id}`, params)

// 获取某个交易记录
const transactionLoad = (id) => axios.get(baseUrl + url.transaction.load + `/${id}`)

// 获取交易记录列表
const transactionPage = (params) => axios.get(baseUrl + url.transaction.page, { params })

export default {
    transactionCreate,
    transactionDelete,
    transactionUpdate,
    transactionLoad,
    transactionPage,
}